<?php
namespace Guider\Model;
use Think\Model;

class UserGuiderModel extends UserModel {
	protected $_auto = [
		["create_time", "time", 1, "function"],
		["update_time", "time", 2, "function"],
	];
	protected $_validate = [
		["id", "require", "ID必须填写!"],
		["principal_id", "require", "用户ID必须填写!"],
		["gender", "require", "性别必须填写!"],
		["guider_type", "require", "导游类型必须填写!"],
		["nationality", "require", "国籍必须填写!"],
		["degree", "require", "学历必须填写!"],
		["college", "require", "毕业院校必须填写!"],
		["star", "require", "星级必须填写!"],
		["price", "require", "价格必须填写!"],
		["special", "require", "特长必须填写!"],
		["justification", "require", "执照必须填写!"],
		["detail", "require", "详情必须填写!"],
		["h5_link", "require", "H5简介链接必须填写!"],
		["create_time", "require", "创建时间必须填写!"],
		["update_time", "require", "更新时间必须填写!"],
	];
	public $excel = false;
	public $fieldMap = [
		"id" => [
			"type" => "input",
			"name" => "ID",
			"show" => true,
			"search" => true,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"principal_id" => [
			"type" => "input",
			"name" => "用户名",
			"show" => true,
			"search" => true,
			"input" => 'create',
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => '<td class="center"><a href="{:U(\'user/list\')}?searchMap[id]={$vo[principal_id]}"><php>echo D(\'User\')->find($vo[principal_id])[\'username\'];</php></a></td>',
			"detail_specify" => '
				<tr>
                    <td class="center" width="20%">用户名</td>
                    <td class="center"><php>echo D(\'User\')->find($detail[principal_id])[\'username\'];</php></td>
                </tr>',
		],
		"gender" => [
			"type" => "select",
			"name" => "性别",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "男,女",
			"list_specify" => "",
		],
		"guider_type" => [
			"type" => "select",
			"name" => "导游类型",
			"show" => true,
			"search" => true,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "大学生导游,社会导游,职业导游,国外导游",
			"list_specify" => "",
		],
		"nationality" => [
			"type" => "input",
			"name" => "国籍",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"degree" => [
			"type" => "input",
			"name" => "学历",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"college" => [
			"type" => "input",
			"name" => "毕业院校",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"star" => [
			"type" => "select",
			"name" => "星级",
			"show" => true,
			"search" => false,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "1,2,3,4,5",
			"list_specify" => "",
		],
		"age" => [
			"type" => "input",
			"name" => "年龄",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],

		"price" => [
			"type" => "input",
			"name" => "价格",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"special" => [
			"type" => "textarea",
			"name" => "特长",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"img" => [
			"type" => "file",
			"name" => "大图",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => false,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => '<td class="center"><img src="__PUBLIC__/file/{$vo[photo]}" width="50" height="50"/></td>',
		],
		"justification" => [
			"type" => "file",
			"name" => "执照",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => false,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => '<td class="center"><img src="__PUBLIC__/file/{$vo[justification]}" width="50" height="50"/></td>',
		],
		"detail" => [
			"type" => "ueditor",
			"name" => "详情",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"h5_link" => [
			"type" => "input",
			"name" => "H5简介",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"create_time" => [
			"type" => "datetime",
			"name" => "创建时间",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
		"update_time" => [
			"type" => "datetime",
			"name" => "更新时间",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
		],
	];
}
